//////////////////////////////////////////////////////////////////////////////////
//
//	Connecting Team Fix
//		- Version 1.0
//		- 04.18.2008
//		- diamond-optic
//
//////////////////////////////////////////////////////////////////////////////////
//
// Information:
//
//	connecting clients should now show as
//	spectators instead of appearing on a team.
//
//////////////////////////////////////////////////////////////////////////////////
//
// Change Log:
//
//	- 11.04.07 - Version 1.0
//		Pulled Connecting Team Fix out of DoD Block Exploits
//
//	- 04.18.08 - Version 1.0 (re-release)
//		Updated public cvar format
//
//////////////////////////////////////////////////////////////////////////////////

//includes
#include <amxmodx>

//version info
#define VERSION "1.0"
#define SVERSION "v1.0 - by diamond-optic (www.AvaMods.com)"

//msgid variable
new g_msgPTeam

public plugin_init()
{
	register_plugin("Connecting Team Fix",VERSION,"diamond-optic")
	register_cvar("amx_connteamfix",SVERSION,FCVAR_SERVER|FCVAR_SPONLY)
	
	g_msgPTeam = get_user_msgid("PTeam")
}

///////////////////////////////////////////////////////////////////
// Client Connect -> connecting team fix
//
public client_connect(id)
{
	if((is_user_connecting(id) || is_user_connected(id)) && !is_user_bot(id))
		{
		message_begin(MSG_BROADCAST,g_msgPTeam,{0,0,0})
		write_byte(id)
		write_byte(3)
		message_end()
		}
}
